package com.wcar.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 积分记录表详情
 * @TableName tb_user_integral_log
 */
@TableName(value ="tb_user_integral_log")
@Data
public class UserIntegralLog implements Serializable {
    /**
     * 积分日志ID
     */
    @TableId(type = IdType.AUTO)
    private Integer integralLogId;

    /**
     * 外键，关联用户ID
     */
    private Integer userId;

    /**
     * 外键关联门店id
     */
    private Integer storeId;

    /**
     * 支出积分
     */
    private Integer expendScore;

    /**
     * 到账积分
     */
    private Integer arrivalScore;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date rechargeTime;
    private String userName;
    private String storeName;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 积分日志ID
     */
    public Integer getIntegralLogId() {
        return integralLogId;
    }

    /**
     * 积分日志ID
     */
    public void setIntegralLogId(Integer integralLogId) {
        this.integralLogId = integralLogId;
    }

    /**
     * 外键，关联用户ID
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 外键，关联用户ID
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 外键关联门店id
     */
    public Integer getStoreId() {
        return storeId;
    }

    /**
     * 外键关联门店id
     */
    public void setStoreId(Integer storeId) {
        this.storeId = storeId;
    }

    /**
     * 支出积分
     */
    public Integer getExpendScore() {
        return expendScore;
    }

    /**
     * 支出积分
     */
    public void setExpendScore(Integer expendScore) {
        this.expendScore = expendScore;
    }

    /**
     * 到账积分
     */
    public Integer getArrivalScore() {
        return arrivalScore;
    }

    /**
     * 到账积分
     */
    public void setArrivalScore(Integer arrivalScore) {
        this.arrivalScore = arrivalScore;
    }

    /**
     * 创建时间
     */
    public Date getRechargeTime() {
        return rechargeTime;
    }

    /**
     * 创建时间
     */
    public void setRechargeTime(Date rechargeTime) {
        this.rechargeTime = rechargeTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserIntegralLog other = (UserIntegralLog) that;
        return (this.getIntegralLogId() == null ? other.getIntegralLogId() == null : this.getIntegralLogId().equals(other.getIntegralLogId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
            && (this.getExpendScore() == null ? other.getExpendScore() == null : this.getExpendScore().equals(other.getExpendScore()))
            && (this.getArrivalScore() == null ? other.getArrivalScore() == null : this.getArrivalScore().equals(other.getArrivalScore()))
            && (this.getRechargeTime() == null ? other.getRechargeTime() == null : this.getRechargeTime().equals(other.getRechargeTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getIntegralLogId() == null) ? 0 : getIntegralLogId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
        result = prime * result + ((getExpendScore() == null) ? 0 : getExpendScore().hashCode());
        result = prime * result + ((getArrivalScore() == null) ? 0 : getArrivalScore().hashCode());
        result = prime * result + ((getRechargeTime() == null) ? 0 : getRechargeTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", integralLogId=").append(integralLogId);
        sb.append(", userId=").append(userId);
        sb.append(", storeId=").append(storeId);
        sb.append(", expendScore=").append(expendScore);
        sb.append(", arrivalScore=").append(arrivalScore);
        sb.append(", rechargeTime=").append(rechargeTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}